﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="LoginView.ascx.cs" Inherits="WebControl_LoginView" %>
<asp:LoginView ID="LoginView1" runat="server">
    <AnonymousTemplate>
        Hi <a href="Login.aspx">Login</a> or <a href="Register.aspx">Register</a>
    </AnonymousTemplate>
    <LoggedInTemplate>
        <div id="notifyCounter"></div>
        Hi
        <asp:LoginName ID="LoginName1" runat="server" />
        <asp:LoginStatus ID="LoginStatus1" runat="server" />
    </LoggedInTemplate>
</asp:LoginView>
<!-- PokeIn Connection Request -->
<script type="text/javascript" src="PokeIn.ashx?ms=connect"></script>
<script>
    //below event fires when PokeIn client side files loaded
    document.OnPokeInReady = function () {
        //Begin!
        PokeIn.Start(function (is_started) {
            if (is_started) {
                document.title = "PokeIn is Connected";
            }
        });

        //OnClose event which fires when this client disconnects from server
        PokeIn.OnClose = function () {
            if (!PokeIn.PageUnloading) {
                document.title = "Reconnecting..";
                PokeIn.ReConnect();
            }
        };
    };

    var elm = document.getElementById('notifyCounter');
    function CheckNewMessage(tm) {
        elm.innerHTML = tm.toLocaleString();
    };
</script>
